//
//  Utility.h
//  NewMonday
//
//  Created by  on 27/10/2011.
//  Copyright (c) 2011 广东薪传 . All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Utility : NSObject



+ (NSString*) getServerUrl;


+ (CGSize)getStringSize:(NSString *)string font:(UIFont *)font withMaxSize:(CGSize)maxSize;

/**
 *计算字符串占有的字节数
 **/
+(int) CountUnicodeByteNumber:(NSString *) str;

/**
 *验证字符串是否为邮箱格式
 */
+(BOOL) ValidateEmail: (NSString *) candidate ;


/**
 *去掉字符串的左右空格
 */
+(NSString *) trim:(NSString *) str;


+(void) customAlertWithMsg:(NSString*) msg andTitle:(NSString*)title andDelagate:(id)delegate;


+(UIButton *)customButton:(id)target action:(SEL)action normalImage:(NSString*)normalImage lightedImage:(NSString*)lightedImage frame:(CGRect) frame title:(NSString *)title tag:(NSUInteger)tag;

+(__autoreleasing NSString*) strFromDate:(NSString*) datestr;

+(__autoreleasing NSString*) strFromSecond:(NSString*) second andFormat:(NSString*)format;
/*图片显示通用方法*/
+(UIImage *) imageNamed:(NSString*) imageName;

/* 设置导航栏的标题 */
+ (UILabel*)getTitleView:(NSString*)titleName;

/* 获取除了状态栏和导航栏外的内容显示的宽度 */
+ (float)getContentWidth;

//用户在圈子里的角色
+(NSString*) getUserRole:(int)type;

/* 获取除了状态栏和导航栏外的内容显示的高度 */
+ (float)getContentHeight;
+(UILabel *) detailTextLabel:(CGRect) rect  andFontSize:(float) fontsize;
+(NSString *) datefromSeconds:(NSString *) strvalue andDateFormat:(NSString *) dateFormat;


@end
